﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using WcfService.ModelLayer;

namespace WcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {
        //Method implemented in class Service1
        [OperationContract]
        int SaveResult(int choice);

        //Method implemented in class Service1
        //Method is made so that it's response and request's is made in Json format
        
        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "MakeChoice",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
            void MakeChoice(Option vResult);

        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "SaveRegId",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        void SaveRegId(User user);

        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "SaveVehicle",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        void SaveVehicle(Vehicle vehicle);

        [OperationContract]
        [WebGet(UriTemplate = "GetVoteObj/{episodeId}",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        VoteObject GetVoteObject(string episodeId);
    }

    
}
